package afsviewer

import (
	"gitee.com/bitwormhole/afsviewer"
	"gitee.com/bitwormhole/afsviewer/gen/main4afsviewer"
	"gitee.com/bitwormhole/afsviewer/gen/test4afsviewer"
	"github.com/starter-go/application"
	"github.com/starter-go/libafs/modules/libafs"
	"github.com/starter-go/libgin/modules/libgin"
	"github.com/starter-go/mimetypes-common/modules/mimetypescommon"
	"github.com/starter-go/mimetypes-icons/modules/mimetypesicons"
)

// Module  ...
func Module() application.Module {
	mb := afsviewer.NewMainModule()
	mb.Components(main4afsviewer.ExportComponents)

	mb.Depend(libgin.Module())
	mb.Depend(libafs.Module())
	mb.Depend(mimetypescommon.Module())
	mb.Depend(mimetypesicons.Module())

	return mb.Create()
}

// ModuleForTest ...
func ModuleForTest() application.Module {
	mb := afsviewer.NewTestModule()
	mb.Components(test4afsviewer.ExportComponents)
	mb.Depend(Module())
	return mb.Create()
}
